\hypertarget{remote__control_8c}{
\section{front\_\-panel/remote\_\-control.c File Reference}
\label{remote__control_8c}\index{front\_\-panel/remote\_\-control.c@{front\_\-panel/remote\_\-control.c}}
}
Remote control of the openASC box.  


{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$avr/io.h$>$}\par
{\tt \#include $<$avr/interrupt.h$>$}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include \char`\"{}event\_\-handler.h\char`\"{}}\par
{\tt \#include \char`\"{}remote\_\-control.h\char`\"{}}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{remote__control_8c_4641cfab8fcccb93a174735067f4df8d}{
\#define \hyperlink{remote__control_8c_4641cfab8fcccb93a174735067f4df8d}{FLAG\_\-REMOTE\_\-CONTROL\_\-MODE\_\-ACTIVE}~0}
\label{remote__control_8c_4641cfab8fcccb93a174735067f4df8d}

\begin{CompactList}\small\item\em Flag that the remote control is active. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hypertarget{remote__control_8c_0d4ebd6fa6b95723e76ac6751b3ddf2a}{
void \hyperlink{remote__control_8c_0d4ebd6fa6b95723e76ac6751b3ddf2a}{remote\_\-control\_\-activate\_\-remote\_\-mode} (void)}
\label{remote__control_8c_0d4ebd6fa6b95723e76ac6751b3ddf2a}

\begin{CompactList}\small\item\em Activate the remote control mode. \item\end{CompactList}\item 
\hypertarget{remote__control_8c_3450530772422ab5f7da96bec5476e07}{
void \hyperlink{remote__control_8c_3450530772422ab5f7da96bec5476e07}{remote\_\-control\_\-deactivate\_\-remote\_\-mode} (void)}
\label{remote__control_8c_3450530772422ab5f7da96bec5476e07}

\begin{CompactList}\small\item\em Deactivate the remote control mode. \item\end{CompactList}\item 
unsigned char \hyperlink{remote__control_8c_fb01e811e87692ce5f5acb4090c761ce}{remote\_\-control\_\-get\_\-remote\_\-mode} (void)
\begin{CompactList}\small\item\em Get the current remote control mode. \item\end{CompactList}\item 
void \hyperlink{remote__control_8c_6a38c529f5cb039d32bcce1dbd4f0170}{remote\_\-control\_\-parse\_\-button} (unsigned char button)
\begin{CompactList}\small\item\em Parse a button press event, will perform an action depending on which button we wish to press. \item\end{CompactList}\item 
void \hyperlink{remote__control_8c_cee15a85d68f7c7b93f4985604f201de}{remote\_\-control\_\-parse\_\-command} (unsigned char command, unsigned char length, char $\ast$data)
\begin{CompactList}\small\item\em Parse a remote control command and perform the proper action. \item\end{CompactList}\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
\hypertarget{remote__control_8c_6e288cc2b105c838c6d70e00282cbf06}{
unsigned char \hyperlink{remote__control_8c_6e288cc2b105c838c6d70e00282cbf06}{remote\_\-control\_\-flags}}
\label{remote__control_8c_6e288cc2b105c838c6d70e00282cbf06}

\begin{CompactList}\small\item\em Flags used in the remote control. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Remote control of the openASC box. 

\begin{Desc}
\item[Author:]Mikael Larsmark, SM2WMV \end{Desc}
\begin{Desc}
\item[Date:]2010-01-25 

\begin{Code}\begin{verbatim} #include "front_panel/remote_control.c" 
\end{verbatim}
\end{Code}

 \end{Desc}


Definition in file \hyperlink{remote__control_8c-source}{remote\_\-control.c}.

\subsection{Function Documentation}
\hypertarget{remote__control_8c_fb01e811e87692ce5f5acb4090c761ce}{
\index{remote\_\-control.c@{remote\_\-control.c}!remote\_\-control\_\-get\_\-remote\_\-mode@{remote\_\-control\_\-get\_\-remote\_\-mode}}
\index{remote\_\-control\_\-get\_\-remote\_\-mode@{remote\_\-control\_\-get\_\-remote\_\-mode}!remote_control.c@{remote\_\-control.c}}
\subsubsection[{remote\_\-control\_\-get\_\-remote\_\-mode}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char remote\_\-control\_\-get\_\-remote\_\-mode (void)}}
\label{remote__control_8c_fb01e811e87692ce5f5acb4090c761ce}


Get the current remote control mode. 

\begin{Desc}
\item[Returns:]1 if remote mode is active, 0 if it is not active \end{Desc}


Definition at line 50 of file remote\_\-control.c.

References FLAG\_\-REMOTE\_\-CONTROL\_\-MODE\_\-ACTIVE, and remote\_\-control\_\-flags.\hypertarget{remote__control_8c_6a38c529f5cb039d32bcce1dbd4f0170}{
\index{remote\_\-control.c@{remote\_\-control.c}!remote\_\-control\_\-parse\_\-button@{remote\_\-control\_\-parse\_\-button}}
\index{remote\_\-control\_\-parse\_\-button@{remote\_\-control\_\-parse\_\-button}!remote_control.c@{remote\_\-control.c}}
\subsubsection[{remote\_\-control\_\-parse\_\-button}]{\setlength{\rightskip}{0pt plus 5cm}void remote\_\-control\_\-parse\_\-button (unsigned char {\em button})}}
\label{remote__control_8c_6a38c529f5cb039d32bcce1dbd4f0170}


Parse a button press event, will perform an action depending on which button we wish to press. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em button}]The button we wish to press \end{description}
\end{Desc}


Definition at line 56 of file remote\_\-control.c.

Referenced by remote\_\-control\_\-parse\_\-command().\hypertarget{remote__control_8c_cee15a85d68f7c7b93f4985604f201de}{
\index{remote\_\-control.c@{remote\_\-control.c}!remote\_\-control\_\-parse\_\-command@{remote\_\-control\_\-parse\_\-command}}
\index{remote\_\-control\_\-parse\_\-command@{remote\_\-control\_\-parse\_\-command}!remote_control.c@{remote\_\-control.c}}
\subsubsection[{remote\_\-control\_\-parse\_\-command}]{\setlength{\rightskip}{0pt plus 5cm}void remote\_\-control\_\-parse\_\-command (unsigned char {\em command}, \/  unsigned char {\em length}, \/  char $\ast$ {\em data})}}
\label{remote__control_8c_cee15a85d68f7c7b93f4985604f201de}


Parse a remote control command and perform the proper action. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em command}]The command we wish to parse \item[{\em length}]The length of the data \item[{\em data}]The data content \end{description}
\end{Desc}


Definition at line 67 of file remote\_\-control.c.

References REMOTE\_\-CONTROL\_\-ACTIVATE\_\-MODE, remote\_\-control\_\-activate\_\-remote\_\-mode(), REMOTE\_\-CONTROL\_\-BUTTON\_\-PRESSED, REMOTE\_\-CONTROL\_\-DEACTIVATE\_\-MODE, remote\_\-control\_\-deactivate\_\-remote\_\-mode(), and remote\_\-control\_\-parse\_\-button().

Referenced by event\_\-internal\_\-comm\_\-parse\_\-message().